package com.extend_.ExtendsDetail;

/**
 * @Author 小闽
 * @Date 2024/8/9 10:33
 * @PackageName: com.extend_.ExtendsDetail
 * @ClassName: Base
 * @Description: 继承细节
 * @Version 1.0
 */
public class Base {
    public int n1 = 100;
    protected int n2 = 200;
    int n3 = 300;
    private int n4 = 400;

    // 构造器(无参)
    public Base(){
        System.out.println("base()...");
    }
    // 构造器(有参，两个参数)
    public Base(String name, int age){
        System.out.println("父类Base(String name, int age)构造器被调用");
    }
    // 构造器(有参，一个参数)
    public Base(String name){
        System.out.println("父类Base(String name)构造器被调用");
    }
    public int getN4(){
        return n4;
    }
    public void test100(){
        System.out.println("test100...");
    }
    protected void test200(){
        System.out.println("test200...");
    }
    void test300(){
        System.out.println("test300...");
    }
    private void test400(){
        System.out.println("test400...");
    }
    public void callTest400(){
        test400();
    }
}
